home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / info / lispref.info-26.z / lispref.info-26
Encoding:
GNU Info File  |  1998-05-21  |  50.8 KB  |  1,243 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo version
  2. 1.68 from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp
  12. Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp
  13. Reference Manual (for 19.15 and 20.1, 20.2) v3.2, April, May 1997
  14.  
  15.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  16. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  17. Copyright (C) 1995, 1996 Ben Wing.
  18.  
  19.    Permission is granted to make and distribute verbatim copies of this
  20. manual provided the copyright notice and this permission notice are
  21. preserved on all copies.
  22.  
  23.    Permission is granted to copy and distribute modified versions of
  24. this manual under the conditions for verbatim copying, provided that the
  25. entire resulting derived work is distributed under the terms of a
  26. permission notice identical to this one.
  27.  
  28.    Permission is granted to copy and distribute translations of this
  29. manual into another language, under the above conditions for modified
  30. versions, except that this permission notice may be stated in a
  31. translation approved by the Foundation.
  32.  
  33.    Permission is granted to copy and distribute modified versions of
  34. this manual under the conditions for verbatim copying, provided also
  35. that the section entitled "GNU General Public License" is included
  36. exactly as in the original, and provided that the entire resulting
  37. derived work is distributed under the terms of a permission notice
  38. identical to this one.
  39.  
  40.    Permission is granted to copy and distribute translations of this
  41. manual into another language, under the above conditions for modified
  42. versions, except that the section entitled "GNU General Public License"
  43. may be included in a translation approved by the Free Software
  44. Foundation instead of in the original English.
  45.  
  46. 
  47. File: lispref.info,  Node: Size and Position,  Next: Frame Name,  Prev: X Frame Properties,  Up: Frame Properties
  48.  
  49. Frame Size And Position
  50. -----------------------
  51.  
  52.    You can read or change the size and position of a frame using the
  53. frame properties `left', `top', `height', and `width'.  Whatever
  54. geometry properties you don't specify are chosen by the window manager
  55. in its usual fashion.
  56.  
  57.    Here are some special features for working with sizes and positions:
  58.  
  59.  - Function: set-frame-position FRAME LEFT TOP
  60.      This function sets the position of the top left corner of FRAME to
  61.      LEFT and TOP.  These arguments are measured in pixels, and count
  62.      from the top left corner of the screen.  Negative property values
  63.      count up or rightward from the top left corner of the screen.
  64.  
  65.  - Function: frame-height &optional FRAME
  66.  - Function: frame-width &optional FRAME
  67.      These functions return the height and width of FRAME, measured in
  68.      lines and columns.  If you don't supply FRAME, they use the
  69.      selected frame.
  70.  
  71.  - Function: frame-pixel-height &optional FRAME
  72.  - Function: frame-pixel-width &optional FRAME
  73.      These functions return the height and width of FRAME, measured in
  74.      pixels.  If you don't supply FRAME, they use the selected frame.
  75.  
  76.  - Function: set-frame-size FRAME COLS ROWS &optional PRETEND
  77.      This function sets the size of FRAME, measured in characters; COLS
  78.      and ROWS specify the new width and height.  (If PRETEND is
  79.      non-nil, it means that redisplay should act as if the frame's size
  80.      is COLS by ROWS, but the actual size of the frame should not be
  81.      changed.  You should not normally use this option.)
  82.  
  83.    You can also use the functions `set-frame-height' and
  84. `set-frame-width' to set the height and width individually.  The frame
  85. is the first argument and the size (in rows or columns) is the second.
  86. (There is an optional third argument, PRETEND, which has the same
  87. purpose as the corresponding argument in `set-frame-size'.)
  88.  
  89. 
  90. File: lispref.info,  Node: Frame Name,  Prev: Size and Position,  Up: Frame Properties
  91.  
  92. The Name of a Frame (As Opposed to Its Title)
  93. ---------------------------------------------
  94.  
  95.    Under X, every frame has a name, which is not the same as the title
  96. of the frame.  A frame's name is used to look up its resources and does
  97. not normally change over the lifetime of a frame.  It is perfectly
  98. allowable, and quite common, for multiple frames to have the same name.
  99.  
  100.  - Function: frame-name &optional FRAME
  101.      This function returns the name of FRAME, which defaults to the
  102.      selected frame if not specified.  The name of a frame can also be
  103.      obtained from the frame's properties.  *Note Frame Properties::.
  104.  
  105.  - Variable: default-frame-name
  106.      This variable holds the default name to assign to newly-created
  107.      frames.  This can be overridden by arguments to `make-frame'.  This
  108.      must be a string.
  109.  
  110. 
  111. File: lispref.info,  Node: Frame Titles,  Next: Deleting Frames,  Prev: Frame Properties,  Up: Frames
  112.  
  113. Frame Titles
  114. ============
  115.  
  116.    Every frame has a title; most window managers display the frame
  117. title at the top of the frame.  You can specify an explicit title with
  118. the `name' frame property.  But normally you don't specify this
  119. explicitly, and XEmacs computes the title automatically.
  120.  
  121.    XEmacs computes the frame title based on a template stored in the
  122. variable `frame-title-format'.
  123.  
  124.  - Variable: frame-title-format
  125.      This variable specifies how to compute a title for a frame when
  126.      you have not explicitly specified one.
  127.  
  128.      The variable's value is actually a modeline construct, just like
  129.      `modeline-format'.  *Note Modeline Data::.
  130.  
  131.  - Variable: frame-icon-title-format
  132.      This variable specifies how to compute the title for an iconified
  133.      frame, when you have not explicitly specified the frame title.
  134.      This title appears in the icon itself.
  135.  
  136.  - Function: x-set-frame-icon-pixmap FRAME PIXMAP &optional MASK
  137.      This function sets the icon of the given frame to the given image
  138.      instance, which should be an image instance object (as returned by
  139.      `make-image-instance'), a glyph object (as returned by
  140.      `make-glyph'), or `nil'.  If a glyph object is given, the glyph
  141.      will be instantiated on the frame to produce an image instance
  142.      object.
  143.  
  144.      If the given image instance has a mask, that will be used as the
  145.      icon mask; however, not all window managers support this.
  146.  
  147.      The window manager is also not required to support color pixmaps,
  148.      only bitmaps (one plane deep).
  149.  
  150.      If the image instance does not have a mask, then the optional
  151.      third argument may be the image instance to use as the mask (it
  152.      must be one plane deep).  *Note Glyphs::.
  153.  
  154. 
  155. File: lispref.info,  Node: Deleting Frames,  Next: Finding All Frames,  Prev: Frame Titles,  Up: Frames
  156.  
  157. Deleting Frames
  158. ===============
  159.  
  160.    Frames remain potentially visible until you explicitly "delete"
  161. them.  A deleted frame cannot appear on the screen, but continues to
  162. exist as a Lisp object until there are no references to it.
  163.  
  164.  - Command: delete-frame &optional FRAME
  165.      This function deletes the frame FRAME.  By default, FRAME is the
  166.      selected frame.
  167.  
  168.  - Function: frame-live-p FRAME
  169.      The function `frame-live-p' returns non-`nil' if the frame FRAME
  170.      has not been deleted.
  171.  
  172. 
  173. File: lispref.info,  Node: Finding All Frames,  Next: Frames and Windows,  Prev: Deleting Frames,  Up: Frames
  174.  
  175. Finding All Frames
  176. ==================
  177.  
  178.  - Function: frame-list
  179.      The function `frame-list' returns a list of all the frames that
  180.      have not been deleted.  It is analogous to `buffer-list' for
  181.      buffers.  The list that you get is newly created, so modifying the
  182.      list doesn't have any effect on the internals of XEmacs.
  183.  
  184.  - Function: device-frame-list &optional DEVICE
  185.      This function returns a list of all frames on DEVICE.  If DEVICE
  186.      is `nil', the selected device will be used.
  187.  
  188.  - Function: visible-frame-list &optional DEVICE
  189.      This function returns a list of just the currently visible frames.
  190.      If DEVICE is specified only frames on that device will be returned.
  191.      *Note Visibility of Frames::.  (TTY frames always count as
  192.      "visible", even though only the selected one is actually
  193.      displayed.)
  194.  
  195.  - Function: next-frame &optional FRAME MINIBUF
  196.      The function `next-frame' lets you cycle conveniently through all
  197.      the frames from an arbitrary starting point.  It returns the "next"
  198.      frame after FRAME in the cycle.  If FRAME is omitted or `nil', it
  199.      defaults to the selected frame.
  200.  
  201.      The second argument, MINIBUF, says which frames to consider:
  202.  
  203.     `nil'
  204.           Exclude minibuffer-only frames.
  205.  
  206.     `visible'
  207.           Consider all visible frames.
  208.  
  209.     0
  210.           Consider all visible or iconified frames.
  211.  
  212.     a window
  213.           Consider only the frames using that particular window as their
  214.           minibuffer.
  215.  
  216.     the symbol `visible'
  217.           Include all visible frames.
  218.  
  219.     `0'
  220.           Include all visible and iconified frames.
  221.  
  222.     anything else
  223.           Consider all frames.
  224.  
  225.  - Function: previous-frame &optional FRAME MINIBUF
  226.      Like `next-frame', but cycles through all frames in the opposite
  227.      direction.
  228.  
  229.    See also `next-window' and `previous-window', in *Note Cyclic Window
  230. Ordering::.
  231.  
  232. 
  233. File: lispref.info,  Node: Frames and Windows,  Next: Minibuffers and Frames,  Prev: Finding All Frames,  Up: Frames
  234.  
  235. Frames and Windows
  236. ==================
  237.  
  238.    Each window is part of one and only one frame; you can get the frame
  239. with `window-frame'.
  240.  
  241.  - Function: frame-root-window &optional FRAME
  242.      This returns the root window of frame FRAME.  FRAME defaults to
  243.      the selected frame if not specified.
  244.  
  245.  - Function: window-frame &optional WINDOW
  246.      This function returns the frame that WINDOW is on.  WINDOW
  247.      defaults to the selected window if omitted.
  248.  
  249.    All the non-minibuffer windows in a frame are arranged in a cyclic
  250. order.  The order runs from the frame's top window, which is at the
  251. upper left corner, down and to the right, until it reaches the window at
  252. the lower right corner (always the minibuffer window, if the frame has
  253. one), and then it moves back to the top.
  254.  
  255.  - Function: frame-top-window FRAME
  256.      This returns the topmost, leftmost window of frame FRAME.
  257.  
  258.    At any time, exactly one window on any frame is "selected within the
  259. frame".  The significance of this designation is that selecting the
  260. frame also selects this window.  You can get the frame's current
  261. selected window with `frame-selected-window'.
  262.  
  263.  - Function: frame-selected-window &optional FRAME
  264.      This function returns the window on FRAME that is selected within
  265.      FRAME.  FRAME defaults to the selected frame if not specified.
  266.  
  267.    Conversely, selecting a window for XEmacs with `select-window' also
  268. makes that window selected within its frame.  *Note Selecting Windows::.
  269.  
  270.    Another function that (usually) returns one of the windows in a
  271. frame is `minibuffer-window'.  *Note Minibuffer Misc::.
  272.  
  273. 
  274. File: lispref.info,  Node: Minibuffers and Frames,  Next: Input Focus,  Prev: Frames and Windows,  Up: Frames
  275.  
  276. Minibuffers and Frames
  277. ======================
  278.  
  279.    Normally, each frame has its own minibuffer window at the bottom,
  280. which is used whenever that frame is selected.  If the frame has a
  281. minibuffer, you can get it with `minibuffer-window' (*note Minibuffer
  282. Misc::.).
  283.  
  284.    However, you can also create a frame with no minibuffer.  Such a
  285. frame must use the minibuffer window of some other frame.  When you
  286. create the frame, you can specify explicitly the minibuffer window to
  287. use (in some other frame).  If you don't, then the minibuffer is found
  288. in the frame which is the value of the variable
  289. `default-minibuffer-frame'.  Its value should be a frame which does
  290. have a minibuffer.
  291.  
  292.  - Variable: default-minibuffer-frame
  293.      This variable specifies the frame to use for the minibuffer
  294.      window, by default.
  295.  
  296. 
  297. File: lispref.info,  Node: Input Focus,  Next: Visibility of Frames,  Prev: Minibuffers and Frames,  Up: Frames
  298.  
  299. Input Focus
  300. ===========
  301.  
  302.    At any time, one frame in XEmacs is the "selected frame".  The
  303. selected window always resides on the selected frame.  As the focus
  304. moves from device to device, the selected frame on each device is
  305. remembered and restored when the focus moves back to that device.
  306.  
  307.  - Function: selected-frame &optional DEVICE
  308.      This function returns the selected frame on DEVICE.  If DEVICE is
  309.      not specified, the selected device will be used.  If no frames
  310.      exist on the device, `nil' is returned.
  311.  
  312.    The X server normally directs keyboard input to the X window that the
  313. mouse is in.  Some window managers use mouse clicks or keyboard events
  314. to "shift the focus" to various X windows, overriding the normal
  315. behavior of the server.
  316.  
  317.    Lisp programs can switch frames "temporarily" by calling the
  318. function `select-frame'.  This does not override the window manager;
  319. rather, it escapes from the window manager's control until that control
  320. is somehow reasserted.
  321.  
  322.    When using a text-only terminal, there is no window manager;
  323. therefore, `select-frame' is the only way to switch frames, and the
  324. effect lasts until overridden by a subsequent call to `select-frame'.
  325. Only the selected terminal frame is actually displayed on the terminal.
  326. Each terminal screen except for the initial one has a number, and the
  327. number of the selected frame appears in the mode line after the word
  328. `XEmacs' (*note Modeline Variables::.).
  329.  
  330.  - Function: select-frame FRAME
  331.      This function selects frame FRAME, temporarily disregarding the
  332.      focus of the X server if any.  The selection of FRAME lasts until
  333.      the next time the user does something to select a different frame,
  334.      or until the next time this function is called.
  335.  
  336.    Note that this does not actually cause the window-system focus to be
  337. set to this frame, or the `select-frame-hook' or `deselect-frame-hook'
  338. to be run, until the next time that XEmacs is waiting for an event.
  339.  
  340. 
  341. File: lispref.info,  Node: Visibility of Frames,  Next: Raising and Lowering,  Prev: Input Focus,  Up: Frames
  342.  
  343. Visibility of Frames
  344. ====================
  345.  
  346.    An X window frame may be "visible", "invisible", or "iconified".  If
  347. it is visible, you can see its contents.  If it is iconified, the
  348. frame's contents do not appear on the screen, but an icon does.  If the
  349. frame is invisible, it doesn't show on the screen, not even as an icon.
  350.  
  351.    Visibility is meaningless for TTY frames, since only the selected
  352. one is actually displayed in any case.
  353.  
  354.  - Command: make-frame-visible &optional FRAME
  355.      This function makes frame FRAME visible.  If you omit FRAME, it
  356.      makes the selected frame visible.
  357.  
  358.  - Command: make-frame-invisible &optional FRAME
  359.      This function makes frame FRAME invisible.
  360.  
  361.  - Command: iconify-frame &optional FRAME
  362.      This function iconifies frame FRAME.
  363.  
  364.  - Command: deiconify-frame &optional FRAME
  365.      This function de-iconifies frame FRAME.  Under X, this is
  366.      equivalent to `make-frame-visible'.
  367.  
  368.  - Function: frame-visible-p FRAME
  369.      This returns whether FRAME is currently "visible" (actually in use
  370.      for display).  A frame that is not visible is not updated, and, if
  371.      it works through a window system, may not show at all.
  372.  
  373.  - Function: frame-iconified-p FRAME
  374.      This returns whether FRAME is iconified.  Not all window managers
  375.      use icons; some merely unmap the window, so this function is not
  376.      the inverse of `frame-visible-p'.  It is possible for a frame to
  377.      not be visible and not be iconified either.  However, if the frame
  378.      is iconified, it will not be visible.  (Under FSF Emacs, the
  379.      functionality of this function is obtained through
  380.      `frame-visible-p'.)
  381.  
  382.  - Function: frame-totally-visible-p FRAME
  383.      This returns whether FRAME is not obscured by any other X windows.
  384.      On TTY frames, this is the same as `frame-visible-p'.
  385.  
  386. 
  387. File: lispref.info,  Node: Raising and Lowering,  Next: Frame Configurations,  Prev: Visibility of Frames,  Up: Frames
  388.  
  389. Raising and Lowering Frames
  390. ===========================
  391.  
  392.    The X Window System uses a desktop metaphor.  Part of this metaphor
  393. is the idea that windows are stacked in a notional third dimension
  394. perpendicular to the screen surface, and thus ordered from "highest" to
  395. "lowest".  Where two windows overlap, the one higher up covers the one
  396. underneath.  Even a window at the bottom of the stack can be seen if no
  397. other window overlaps it.
  398.  
  399.    A window's place in this ordering is not fixed; in fact, users tend
  400. to change the order frequently.  "Raising" a window means moving it
  401. "up", to the top of the stack.  "Lowering" a window means moving it to
  402. the bottom of the stack.  This motion is in the notional third
  403. dimension only, and does not change the position of the window on the
  404. screen.
  405.  
  406.    You can raise and lower XEmacs's X windows with these functions:
  407.  
  408.  - Command: raise-frame &optional FRAME
  409.      This function raises frame FRAME.
  410.  
  411.  - Command: lower-frame &optional FRAME
  412.      This function lowers frame FRAME.
  413.  
  414.    You can also specify auto-raise (raising automatically when a frame
  415. is selected) or auto-lower (lowering automatically when it is
  416. deselected).  Under X, most ICCCM-compliant window managers will have
  417. an option to do this for you, but the following variables are provided
  418. in case you're using a broken WM.  (Under FSF Emacs, the same
  419. functionality is provided through the `auto-raise' and `auto-lower'
  420. frame properties.)
  421.  
  422.  - Variable: auto-raise-frame
  423.      This variable's value is `t' if frames will be raised to the top
  424.      when selected.
  425.  
  426.  - Variable: auto-lower-frame
  427.      This variable's value is `t' if frames will be lowered to the
  428.      bottom when no longer selected.
  429.  
  430.    Auto-raising and auto-lowering is implemented through functions
  431. attached to `select-frame-hook' and `deselect-frame-hook' (*note Frame
  432. Hooks::.).  Under normal circumstances, you should not call these
  433. functions directly.
  434.  
  435.  - Function: default-select-frame-hook
  436.      This hook function implements the `auto-raise-frame' variable; it
  437.      is for use as the value of `select-frame-hook'.
  438.  
  439.  - Function: default-deselect-frame-hook
  440.      This hook function implements the `auto-lower-frame' variable; it
  441.      is for use as the value of `deselect-frame-hook'.
  442.  
  443. 
  444. File: lispref.info,  Node: Frame Configurations,  Next: Frame Hooks,  Prev: Raising and Lowering,  Up: Frames
  445.  
  446. Frame Configurations
  447. ====================
  448.  
  449.    A "frame configuration" records the current arrangement of frames,
  450. all their properties, and the window configuration of each one.
  451.  
  452.  - Function: current-frame-configuration
  453.      This function returns a frame configuration list that describes
  454.      the current arrangement of frames and their contents.
  455.  
  456.  - Function: set-frame-configuration CONFIGURATION
  457.      This function restores the state of frames described in
  458.      CONFIGURATION.
  459.  
  460. 
  461. File: lispref.info,  Node: Frame Hooks,  Prev: Frame Configurations,  Up: Frames
  462.  
  463. Hooks for Customizing Frame Behavior
  464. ====================================
  465.  
  466.    XEmacs provides many hooks that are called at various times during a
  467. frame's lifetime.  *Note Hooks::.
  468.  
  469.  - Variable: create-frame-hook
  470.      This hook is called each time a frame is created.  The functions
  471.      are called with one argument, the newly-created frame.
  472.  
  473.  - Variable: delete-frame-hook
  474.      This hook is called each time a frame is deleted.  The functions
  475.      are called with one argument, the about-to-be-deleted frame.
  476.  
  477.  - Variable: select-frame-hook
  478.      This is a normal hook that is run just after a frame is selected.
  479.      The function `default-select-frame-hook', which implements
  480.      auto-raising (*note Raising and Lowering::.), is normally attached
  481.      to this hook.
  482.  
  483.      Note that calling `select-frame' does not necessarily set the
  484.      focus: The actual window-system focus will not be changed until
  485.      the next time that XEmacs is waiting for an event, and even then,
  486.      the window manager may refuse the focus-change request.
  487.  
  488.  - Variable: deselect-frame-hook
  489.      This is a normal hook that is run just before a frame is deselected
  490.      (and another frame is selected).  The function
  491.      `default-deselect-frame-hook', which implements auto-lowering
  492.      (*note Raising and Lowering::.), is normally attached to this hook.
  493.  
  494.  - Variable: map-frame-hook
  495.      This hook is called each time a frame is mapped (i.e. made
  496.      visible).  The functions are called with one argument, the newly
  497.      mapped frame.
  498.  
  499.  - Variable: unmap-frame-hook
  500.      This hook is called each time a frame is unmapped (i.e. made
  501.      invisible or iconified).  The functions are called with one
  502.      argument, the newly unmapped frame.
  503.  
  504. 
  505. File: lispref.info,  Node: Consoles and Devices,  Next: Positions,  Prev: Frames,  Up: Top
  506.  
  507. Consoles and Devices
  508. ********************
  509.  
  510.    A "console" is an object representing a single input connection to
  511. XEmacs, such as an X display or a TTY connection.  It is possible for
  512. XEmacs to have frames on multiple consoles at once (even on
  513. heterogeneous types - you can simultaneously have a frame on an X
  514. display and a TTY connection).  Normally, there is only one console in
  515. existence.
  516.  
  517.    A "device" is an object representing a single output device, such as
  518. a particular screen on an X display. (Usually there is exactly one
  519. device per X console connection, but there may be more than one if you
  520. have a multi-headed X display.  For TTY connections, there is always
  521. exactly one device per console.)
  522.  
  523.    Each device has one or more "frames" in which text can be displayed.
  524. For X displays and the like, a frame corresponds to the normal
  525. window-system concept of a window.  Frames can overlap, be displayed at
  526. various locations within the display, be resized, etc.  For TTY, only
  527. one frame can be displayed at a time, and it occupies the entire TTY
  528. display area.
  529.  
  530.    However, you can still define multiple frames and switch between
  531. them.  Their contents are entirely separate from each other.  These
  532. sorts of frames resemble the "virtual console" capability provided
  533. under Linux or the multiple screens provided by the multiplexing program
  534. `screen' under Unix.
  535.  
  536.    When you start up XEmacs, an initial console and device are created
  537. to receive input and display frames on.  This will either be an X
  538. display or a TTY connection, depending on what mode you started XEmacs
  539. in (this is determined by the `DISPLAY' environment variable, the
  540. `-nw', `-t' and `-display' command-line options, etc.).
  541.  
  542.    You can connect to other X displays and TTY connections by creating
  543. new console objects, and to other X screens on an existing display by
  544. creating new device objects, as described below.  Many functions (for
  545. example the frame-creation functions) take an optional device argument
  546. specifying which device the function pertains to.  If the argument is
  547. omitted, it defaults to the selected device (see below).
  548.  
  549.  - Function: consolep OBJECT
  550.      This returns non-`nil' if OBJECT is a console.
  551.  
  552.  - Function: devicep OBJECT
  553.      This returns non-`nil' if OBJECT is a device.
  554.  
  555. * Menu:
  556.  
  557. * Basic Console Functions::     Functions for working with consoles.
  558. * Basic Device Functions::      Functions for working with devices.
  559. * Console Types and Device Classes::
  560.                                 I/O and color characteristics.
  561. * Connecting to a Console or Device::
  562. * The Selected Console and Device::
  563. * Console and Device I/O::      Controlling input and output.
  564.  
  565. 
  566. File: lispref.info,  Node: Basic Console Functions,  Next: Basic Device Functions,  Up: Consoles and Devices
  567.  
  568. Basic Console Functions
  569. =======================
  570.  
  571.  - Function: console-list
  572.      This function returns a list of all existing consoles.
  573.  
  574.  - Function: console-device-list &optional CONSOLE
  575.      This function returns a list of all devices on CONSOLE.  If
  576.      CONSOLE is `nil', the selected console will be used.
  577.  
  578. 
  579. File: lispref.info,  Node: Basic Device Functions,  Next: Console Types and Device Classes,  Prev: Basic Console Functions,  Up: Consoles and Devices
  580.  
  581. Basic Device Functions
  582. ======================
  583.  
  584.  - Function: device-list
  585.      This function returns a list of all existing devices.
  586.  
  587.  - Function: device-or-frame-p OBJECT
  588.      This function returns non-`nil' if OBJECT is a device or frame.
  589.      This function is useful because devices and frames are similar in
  590.      many respects and many functions can operate on either one.
  591.  
  592.  - Function: device-frame-list DEVICE
  593.      This function returns a list of all frames on DEVICE.
  594.  
  595.  - Function: frame-device FRAME
  596.      This function returns the device that FRAME is on.
  597.  
  598. 
  599. File: lispref.info,  Node: Console Types and Device Classes,  Next: Connecting to a Console or Device,  Prev: Basic Device Functions,  Up: Consoles and Devices
  600.  
  601. Console Types and Device Classes
  602. ================================
  603.  
  604.    Every device is of a particular "type", which describes how the
  605. connection to that device is made and how the device operates, and a
  606. particular "class", which describes other characteristics of the device
  607. (currently, the color capabilities of the device).
  608.  
  609.    The currently-defined device types are
  610.  
  611. `x'
  612.      A connection to an X display (such as `willow:0').
  613.  
  614. `tty'
  615.      A connection to a tty (such as `/dev/ttyp3').
  616.  
  617. `stream'
  618.      A stdio connection.  This describes a device for which input and
  619.      output is only possible in a stream-like fashion, such as when
  620.      XEmacs in running in batch mode.  The very first device created by
  621.      XEmacs is a terminal device and is used to print out messages of
  622.      various sorts (for example, the help message when you use the
  623.      `-help' command-line option).
  624.  
  625.    The currently-defined device classes are
  626. `color'
  627.      A color device.
  628.  
  629. `grayscale'
  630.      A grayscale device (a device that can display multiple shades of
  631.      gray, but no color).
  632.  
  633. `mono'
  634.      A device that can only display two colors (e.g. black and white).
  635.  
  636.  - Function: device-type DEVICE
  637.      This function returns the type of DEVICE.  This is a symbol whose
  638.      name is one of the device types mentioned above.
  639.  
  640.  - Function: device-or-frame-type DEVICE-OR-FRAME
  641.      This function returns the type of DEVICE-OR-FRAME.
  642.  
  643.  - Function: device-class DEVICE
  644.      This function returns the class (color behavior) of DEVICE.  This
  645.      is a symbol whose name is one of the device classes mentioned
  646.      above.
  647.  
  648.  - Function: valid-device-type-p DEVICE-TYPE
  649.      This function returns whether DEVICE-TYPE (which should be a
  650.      symbol) species a valid device type.
  651.  
  652.  - Function: valid-device-class-p DEVICE-CLASS
  653.      This function returns whether DEVICE-CLASS (which should be a
  654.      symbol) species a valid device class.
  655.  
  656.  - Variable: terminal-device
  657.      This variable holds the initial terminal device object, which
  658.      represents XEmacs's stdout.
  659.  
  660. 
  661. File: lispref.info,  Node: Connecting to a Console or Device,  Next: The Selected Console and Device,  Prev: Console Types and Device Classes,  Up: Consoles and Devices
  662.  
  663. Connecting to a Console or Device
  664. =================================
  665.  
  666.  - Function: make-device &optional TYPE DEVICE-DATA
  667.      This function creates a new device.
  668.  
  669.    The following two functions create devices of specific types and are
  670. written in terms of `make-device'.
  671.  
  672.  - Function: make-tty-device &optional TTY TERMINAL-TYPE
  673.      This function creates a new tty device on TTY.  This also creates
  674.      the tty's first frame.  TTY should be a string giving the name of
  675.      a tty device file (e.g. `/dev/ttyp3' under SunOS et al.), as
  676.      returned by the `tty' command issued from the Unix shell.  A value
  677.      of `nil' means use the stdin and stdout as passed to XEmacs from
  678.      the shell.  If TERMINAL-TYPE is non-`nil', it should be a string
  679.      specifying the type of the terminal attached to the specified tty.
  680.      If it is `nil', the terminal type will be inferred from the
  681.      `TERM' environment variable.
  682.  
  683.  - Function: make-x-device &optional DISPLAY ARGV-LIST
  684.      This function creates a new device connected to DISPLAY.  Optional
  685.      argument ARGV-LIST is a list of strings describing command line
  686.      options.
  687.  
  688.  - Function: delete-device DEVICE
  689.      This function deletes DEVICE, permanently eliminating it from use.
  690.      This disconnects XEmacs's connection to the device.
  691.  
  692.  - Variable: create-device-hook
  693.      This variable, if non-`nil', should contain a list of functions,
  694.      which are called when a device is created.
  695.  
  696.  - Variable: delete-device-hook
  697.      This variable, if non-`nil', should contain a list of functions,
  698.      which are called when a device is deleted.
  699.  
  700.  - Function: console-live-p OBJECT
  701.      This function returns non-`nil' if OBJECT is a console that has
  702.      not been deleted.
  703.  
  704.  - Function: device-live-p OBJECT
  705.      This function returns non-`nil' if OBJECT is a device that has not
  706.      been deleted.
  707.  
  708.  - Function: device-x-display DEVICE
  709.      This function returns the X display which DEVICE is connected to,
  710.      if DEVICE is an X device.
  711.  
  712. 
  713. File: lispref.info,  Node: The Selected Console and Device,  Next: Console and Device I/O,  Prev: Connecting to a Console or Device,  Up: Consoles and Devices
  714.  
  715. The Selected Console and Device
  716. ===============================
  717.  
  718.  - Function: select-console CONSOLE
  719.      This function selects the console CONSOLE.  Subsequent editing
  720.      commands apply to its selected device, selected frame, and selected
  721.      window.  The selection of CONSOLE lasts until the next time the
  722.      user does something to select a different console, or until the
  723.      next time this function is called.
  724.  
  725.  - Function: selected-console
  726.      This function returns the console which is currently active.
  727.  
  728.  - Function: select-device DEVICE
  729.      This function selects the device DEVICE.
  730.  
  731.  - Function: selected-device &optional CONSOLE
  732.      This function returns the device which is currently active.  If
  733.      optional CONSOLE is non-`nil', this function returns the device
  734.      that would be currently active if CONSOLE were the selected
  735.      console.
  736.  
  737. 
  738. File: lispref.info,  Node: Console and Device I/O,  Prev: The Selected Console and Device,  Up: Consoles and Devices
  739.  
  740. Console and Device I/O
  741. ======================
  742.  
  743.  - Function: console-disable-input CONSOLE
  744.      This function disables input on console CONSOLE.
  745.  
  746.  - Function: console-enable-input CONSOLE
  747.      This function enables input on console CONSOLE.
  748.  
  749.    Each device has a "baud rate" value associated with it.  On most
  750. systems, changing this value will affect the amount of padding and
  751. other strategic decisions made during redisplay.
  752.  
  753.  - Function: device-baud-rate &optional DEVICE
  754.      This function returns the output baud rate of DEVICE.
  755.  
  756.  - Function: set-device-baud-rate DEVICE RATE
  757.      This function sets the output baud rate of DEVICE to RATE.
  758.  
  759. 
  760. File: lispref.info,  Node: Positions,  Next: Markers,  Prev: Consoles and Devices,  Up: Top
  761.  
  762. Positions
  763. *********
  764.  
  765.    A "position" is the index of a character in the text of a buffer.
  766. More precisely, a position identifies the place between two characters
  767. (or before the first character, or after the last character), so we can
  768. speak of the character before or after a given position.  However, we
  769. often speak of the character "at" a position, meaning the character
  770. after that position.
  771.  
  772.    Positions are usually represented as integers starting from 1, but
  773. can also be represented as "markers"--special objects that relocate
  774. automatically when text is inserted or deleted so they stay with the
  775. surrounding characters.  *Note Markers::.
  776.  
  777. * Menu:
  778.  
  779. * Point::         The special position where editing takes place.
  780. * Motion::        Changing point.
  781. * Excursions::    Temporary motion and buffer changes.
  782. * Narrowing::     Restricting editing to a portion of the buffer.
  783.  
  784. 
  785. File: lispref.info,  Node: Point,  Next: Motion,  Up: Positions
  786.  
  787. Point
  788. =====
  789.  
  790.    "Point" is a special buffer position used by many editing commands,
  791. including the self-inserting typed characters and text insertion
  792. functions.  Other commands move point through the text to allow editing
  793. and insertion at different places.
  794.  
  795.    Like other positions, point designates a place between two characters
  796. (or before the first character, or after the last character), rather
  797. than a particular character.  Usually terminals display the cursor over
  798. the character that immediately follows point; point is actually before
  799. the character on which the cursor sits.
  800.  
  801.    The value of point is a number between 1 and the buffer size plus 1.
  802. If narrowing is in effect (*note Narrowing::.), then point is
  803. constrained to fall within the accessible portion of the buffer
  804. (possibly at one end of it).
  805.  
  806.    Each buffer has its own value of point, which is independent of the
  807. value of point in other buffers.  Each window also has a value of point,
  808. which is independent of the value of point in other windows on the same
  809. buffer.  This is why point can have different values in various windows
  810. that display the same buffer.  When a buffer appears in only one window,
  811. the buffer's point and the window's point normally have the same value,
  812. so the distinction is rarely important.  *Note Window Point::, for more
  813. details.
  814.  
  815.  - Function: point &optional BUFFER
  816.      This function returns the value of point in BUFFER, as an integer.
  817.      BUFFER defaults to the current buffer if omitted.
  818.  
  819.           (point)
  820.                => 175
  821.  
  822.  - Function: point-min &optional BUFFER
  823.      This function returns the minimum accessible value of point in
  824.      BUFFER.  This is normally 1, but if narrowing is in effect, it is
  825.      the position of the start of the region that you narrowed to.
  826.      (*Note Narrowing::.) BUFFER defaults to the current buffer if
  827.      omitted.
  828.  
  829.  - Function: point-max &optional BUFFER
  830.      This function returns the maximum accessible value of point in
  831.      BUFFER.  This is `(1+ (buffer-size buffer))', unless narrowing is
  832.      in effect, in which case it is the position of the end of the
  833.      region that you narrowed to. (*Note Narrowing::).  BUFFER defaults
  834.      to the current buffer if omitted.
  835.  
  836.  - Function: buffer-end FLAG &optional BUFFER
  837.      This function returns `(point-min buffer)' if FLAG is less than 1,
  838.      `(point-max buffer)' otherwise.  The argument FLAG must be a
  839.      number.  BUFFER defaults to the current buffer if omitted.
  840.  
  841.  - Function: buffer-size &optional BUFFER
  842.      This function returns the total number of characters in BUFFER.
  843.      In the absence of any narrowing (*note Narrowing::.), `point-max'
  844.      returns a value one larger than this.  BUFFER defaults to the
  845.      current buffer if omitted.
  846.  
  847.           (buffer-size)
  848.                => 35
  849.           (point-max)
  850.                => 36
  851.  
  852.  - Variable: buffer-saved-size
  853.      The value of this buffer-local variable is the former length of the
  854.      current buffer, as of the last time it was read in, saved or
  855.      auto-saved.
  856.  
  857. 
  858. File: lispref.info,  Node: Motion,  Next: Excursions,  Prev: Point,  Up: Positions
  859.  
  860. Motion
  861. ======
  862.  
  863.    Motion functions change the value of point, either relative to the
  864. current value of point, relative to the beginning or end of the buffer,
  865. or relative to the edges of the selected window.  *Note Point::.
  866.  
  867. * Menu:
  868.  
  869. * Character Motion::       Moving in terms of characters.
  870. * Word Motion::            Moving in terms of words.
  871. * Buffer End Motion::      Moving to the beginning or end of the buffer.
  872. * Text Lines::             Moving in terms of lines of text.
  873. * Screen Lines::           Moving in terms of lines as displayed.
  874. * List Motion::            Moving by parsing lists and sexps.
  875. * Skipping Characters::    Skipping characters belonging to a certain set.
  876.  
  877. 
  878. File: lispref.info,  Node: Character Motion,  Next: Word Motion,  Up: Motion
  879.  
  880. Motion by Characters
  881. --------------------
  882.  
  883.    These functions move point based on a count of characters.
  884. `goto-char' is the fundamental primitive; the other functions use that.
  885.  
  886.  - Command: goto-char POSITION &optional BUFFER
  887.      This function sets point in `buffer' to the value POSITION.  If
  888.      POSITION is less than 1, it moves point to the beginning of the
  889.      buffer.  If POSITION is greater than the length of the buffer, it
  890.      moves point to the end.  BUFFER defaults to the current buffer if
  891.      omitted.
  892.  
  893.      If narrowing is in effect, POSITION still counts from the
  894.      beginning of the buffer, but point cannot go outside the accessible
  895.      portion.  If POSITION is out of range, `goto-char' moves point to
  896.      the beginning or the end of the accessible portion.
  897.  
  898.      When this function is called interactively, POSITION is the
  899.      numeric prefix argument, if provided; otherwise it is read from the
  900.      minibuffer.
  901.  
  902.      `goto-char' returns POSITION.
  903.  
  904.  - Command: forward-char &optional COUNT BUFFER
  905.      This function moves point COUNT characters forward, towards the
  906.      end of the buffer (or backward, towards the beginning of the
  907.      buffer, if COUNT is negative).  If the function attempts to move
  908.      point past the beginning or end of the buffer (or the limits of
  909.      the accessible portion, when narrowing is in effect), an error is
  910.      signaled with error code `beginning-of-buffer' or `end-of-buffer'.
  911.      BUFFER defaults to the current buffer if omitted.
  912.  
  913.      In an interactive call, COUNT is the numeric prefix argument.
  914.  
  915.  - Command: backward-char &optional COUNT BUFFER
  916.      This function moves point COUNT characters backward, towards the
  917.      beginning of the buffer (or forward, towards the end of the
  918.      buffer, if COUNT is negative).  If the function attempts to move
  919.      point past the beginning or end of the buffer (or the limits of
  920.      the accessible portion, when narrowing is in effect), an error is
  921.      signaled with error code `beginning-of-buffer' or `end-of-buffer'.
  922.      BUFFER defaults to the current buffer if omitted.
  923.  
  924.      In an interactive call, COUNT is the numeric prefix argument.
  925.  
  926. 
  927. File: lispref.info,  Node: Word Motion,  Next: Buffer End Motion,  Prev: Character Motion,  Up: Motion
  928.  
  929. Motion by Words
  930. ---------------
  931.  
  932.    These functions for parsing words use the syntax table to decide
  933. whether a given character is part of a word.  *Note Syntax Tables::.
  934.  
  935.  - Command: forward-word COUNT &optional BUFFER
  936.      This function moves point forward COUNT words (or backward if
  937.      COUNT is negative).  Normally it returns `t'.  If this motion
  938.      encounters the beginning or end of the buffer, or the limits of the
  939.      accessible portion when narrowing is in effect, point stops there
  940.      and the value is `nil'.  BUFFER defaults to the current buffer if
  941.      omitted.
  942.  
  943.      In an interactive call, COUNT is set to the numeric prefix
  944.      argument.
  945.  
  946.  - Command: backward-word COUNT &optional BUFFER
  947.      This function is just like `forward-word', except that it moves
  948.      backward until encountering the front of a word, rather than
  949.      forward.  BUFFER defaults to the current buffer if omitted.
  950.  
  951.      In an interactive call, COUNT is set to the numeric prefix
  952.      argument.
  953.  
  954.      This function is rarely used in programs, as it is more efficient
  955.      to call `forward-word' with a negative argument.
  956.  
  957.  - Variable: words-include-escapes
  958.      This variable affects the behavior of `forward-word' and everything
  959.      that uses it.  If it is non-`nil', then characters in the "escape"
  960.      and "character quote" syntax classes count as part of words.
  961.      Otherwise, they do not.
  962.  
  963. 
  964. File: lispref.info,  Node: Buffer End Motion,  Next: Text Lines,  Prev: Word Motion,  Up: Motion
  965.  
  966. Motion to an End of the Buffer
  967. ------------------------------
  968.  
  969.    To move point to the beginning of the buffer, write:
  970.  
  971.      (goto-char (point-min))
  972.  
  973. Likewise, to move to the end of the buffer, use:
  974.  
  975.      (goto-char (point-max))
  976.  
  977.    Here are two commands that users use to do these things.  They are
  978. documented here to warn you not to use them in Lisp programs, because
  979. they set the mark and display messages in the echo area.
  980.  
  981.  - Command: beginning-of-buffer &optional N
  982.      This function moves point to the beginning of the buffer (or the
  983.      limits of the accessible portion, when narrowing is in effect),
  984.      setting the mark at the previous position.  If N is non-`nil',
  985.      then it puts point N tenths of the way from the beginning of the
  986.      buffer.
  987.  
  988.      In an interactive call, N is the numeric prefix argument, if
  989.      provided; otherwise N defaults to `nil'.
  990.  
  991.      Don't use this function in Lisp programs!
  992.  
  993.  - Command: end-of-buffer &optional N
  994.      This function moves point to the end of the buffer (or the limits
  995.      of the accessible portion, when narrowing is in effect), setting
  996.      the mark at the previous position.  If N is non-`nil', then it puts
  997.      point N tenths of the way from the end of the buffer.
  998.  
  999.      In an interactive call, N is the numeric prefix argument, if
  1000.      provided; otherwise N defaults to `nil'.
  1001.  
  1002.      Don't use this function in Lisp programs!
  1003.  
  1004. 
  1005. File: lispref.info,  Node: Text Lines,  Next: Screen Lines,  Prev: Buffer End Motion,  Up: Motion
  1006.  
  1007. Motion by Text Lines
  1008. --------------------
  1009.  
  1010.    Text lines are portions of the buffer delimited by newline
  1011. characters, which are regarded as part of the previous line.  The first
  1012. text line begins at the beginning of the buffer, and the last text line
  1013. ends at the end of the buffer whether or not the last character is a
  1014. newline.  The division of the buffer into text lines is not affected by
  1015. the width of the window, by line continuation in display, or by how
  1016. tabs and control characters are displayed.
  1017.  
  1018.  - Command: goto-line LINE
  1019.      This function moves point to the front of the LINEth line,
  1020.      counting from line 1 at beginning of the buffer.  If LINE is less
  1021.      than 1, it moves point to the beginning of the buffer.  If LINE is
  1022.      greater than the number of lines in the buffer, it moves point to
  1023.      the end of the buffer--that is, the *end of the last line* of the
  1024.      buffer.  This is the only case in which `goto-line' does not
  1025.      necessarily move to the beginning of a line.
  1026.  
  1027.      If narrowing is in effect, then LINE still counts from the
  1028.      beginning of the buffer, but point cannot go outside the accessible
  1029.      portion.  So `goto-line' moves point to the beginning or end of the
  1030.      accessible portion, if the line number specifies an inaccessible
  1031.      position.
  1032.  
  1033.      The return value of `goto-line' is the difference between LINE and
  1034.      the line number of the line to which point actually was able to
  1035.      move (in the full buffer, before taking account of narrowing).
  1036.      Thus, the value is positive if the scan encounters the real end of
  1037.      the buffer.  The value is zero if scan encounters the end of the
  1038.      accessible portion but not the real end of the buffer.
  1039.  
  1040.      In an interactive call, LINE is the numeric prefix argument if one
  1041.      has been provided.  Otherwise LINE is read in the minibuffer.
  1042.  
  1043.  - Command: beginning-of-line &optional COUNT BUFFER
  1044.      This function moves point to the beginning of the current line.
  1045.      With an argument COUNT not `nil' or 1, it moves forward COUNT-1
  1046.      lines and then to the beginning of the line.  BUFFER defaults to
  1047.      the current buffer if omitted.
  1048.  
  1049.      If this function reaches the end of the buffer (or of the
  1050.      accessible portion, if narrowing is in effect), it positions point
  1051.      there.  No error is signaled.
  1052.  
  1053.  - Command: end-of-line &optional COUNT BUFFER
  1054.      This function moves point to the end of the current line.  With an
  1055.      argument COUNT not `nil' or 1, it moves forward COUNT-1 lines and
  1056.      then to the end of the line.  BUFFER defaults to the current
  1057.      buffer if omitted.
  1058.  
  1059.      If this function reaches the end of the buffer (or of the
  1060.      accessible portion, if narrowing is in effect), it positions point
  1061.      there.  No error is signaled.
  1062.  
  1063.  - Command: forward-line &optional COUNT BUFFER
  1064.      This function moves point forward COUNT lines, to the beginning of
  1065.      the line.  If COUNT is negative, it moves point -COUNT lines
  1066.      backward, to the beginning of a line.  If COUNT is zero, it moves
  1067.      point to the beginning of the current line.  BUFFER defaults to
  1068.      the current buffer if omitted.
  1069.  
  1070.      If `forward-line' encounters the beginning or end of the buffer (or
  1071.      of the accessible portion) before finding that many lines, it sets
  1072.      point there.  No error is signaled.
  1073.  
  1074.      `forward-line' returns the difference between COUNT and the number
  1075.      of lines actually moved.  If you attempt to move down five lines
  1076.      from the beginning of a buffer that has only three lines, point
  1077.      stops at the end of the last line, and the value will be 2.
  1078.  
  1079.      In an interactive call, COUNT is the numeric prefix argument.
  1080.  
  1081.  - Function: count-lines START END
  1082.      This function returns the number of lines between the positions
  1083.      START and END in the current buffer.  If START and END are equal,
  1084.      then it returns 0.  Otherwise it returns at least 1, even if START
  1085.      and END are on the same line.  This is because the text between
  1086.      them, considered in isolation, must contain at least one line
  1087.      unless it is empty.
  1088.  
  1089.      Here is an example of using `count-lines':
  1090.  
  1091.           (defun current-line ()
  1092.             "Return the vertical position of point..."
  1093.             (+ (count-lines (window-start) (point))
  1094.                (if (= (current-column) 0) 1 0)
  1095.                -1))
  1096.  
  1097.    Also see the functions `bolp' and `eolp' in *Note Near Point::.
  1098. These functions do not move point, but test whether it is already at the
  1099. beginning or end of a line.
  1100.  
  1101. 
  1102. File: lispref.info,  Node: Screen Lines,  Next: List Motion,  Prev: Text Lines,  Up: Motion
  1103.  
  1104. Motion by Screen Lines
  1105. ----------------------
  1106.  
  1107.    The line functions in the previous section count text lines,
  1108. delimited only by newline characters.  By contrast, these functions
  1109. count screen lines, which are defined by the way the text appears on
  1110. the screen.  A text line is a single screen line if it is short enough
  1111. to fit the width of the selected window, but otherwise it may occupy
  1112. several screen lines.
  1113.  
  1114.    In some cases, text lines are truncated on the screen rather than
  1115. continued onto additional screen lines.  In these cases,
  1116. `vertical-motion' moves point much like `forward-line'.  *Note
  1117. Truncation::.
  1118.  
  1119.    Because the width of a given string depends on the flags that control
  1120. the appearance of certain characters, `vertical-motion' behaves
  1121. differently, for a given piece of text, depending on the buffer it is
  1122. in, and even on the selected window (because the width, the truncation
  1123. flag, and display table may vary between windows).  *Note Usual
  1124. Display::.
  1125.  
  1126.    These functions scan text to determine where screen lines break, and
  1127. thus take time proportional to the distance scanned.  If you intend to
  1128. use them heavily, Emacs provides caches which may improve the
  1129. performance of your code.  *Note cache-long-line-scans: Text Lines.
  1130.  
  1131.  - Function: vertical-motion COUNT &optional WINDOW
  1132.      This function moves point to the start of the screen line COUNT
  1133.      screen lines down from the screen line containing point.  If COUNT
  1134.      is negative, it moves up instead.
  1135.  
  1136.      `vertical-motion' returns the number of lines moved.  The value may
  1137.      be less in absolute value than COUNT if the beginning or end of
  1138.      the buffer was reached.
  1139.  
  1140.      The window WINDOW is used for obtaining parameters such as the
  1141.      width, the horizontal scrolling, and the display table.  But
  1142.      `vertical-motion' always operates on the current buffer, even if
  1143.      WINDOW currently displays some other buffer.
  1144.  
  1145.  - Command: move-to-window-line COUNT &optional WINDOW
  1146.      This function moves point with respect to the text currently
  1147.      displayed in WINDOW, which defaults to the selected window.  It
  1148.      moves point to the beginning of the screen line COUNT screen lines
  1149.      from the top of the window.  If COUNT is negative, that specifies a
  1150.      position -COUNT lines from the bottom (or the last line of the
  1151.      buffer, if the buffer ends above the specified screen position).
  1152.  
  1153.      If COUNT is `nil', then point moves to the beginning of the line
  1154.      in the middle of the window.  If the absolute value of COUNT is
  1155.      greater than the size of the window, then point moves to the place
  1156.      that would appear on that screen line if the window were tall
  1157.      enough.  This will probably cause the next redisplay to scroll to
  1158.      bring that location onto the screen.
  1159.  
  1160.      In an interactive call, COUNT is the numeric prefix argument.
  1161.  
  1162.      The value returned is the window line number point has moved to,
  1163.      with the top line in the window numbered 0.
  1164.  
  1165. 
  1166. File: lispref.info,  Node: List Motion,  Next: Skipping Characters,  Prev: Screen Lines,  Up: Motion
  1167.  
  1168. Moving over Balanced Expressions
  1169. --------------------------------
  1170.  
  1171.    Here are several functions concerned with balanced-parenthesis
  1172. expressions (also called "sexps" in connection with moving across them
  1173. in XEmacs).  The syntax table controls how these functions interpret
  1174. various characters; see *Note Syntax Tables::.  *Note Parsing
  1175. Expressions::, for lower-level primitives for scanning sexps or parts of
  1176. sexps.  For user-level commands, see *Note Lists and Sexps:
  1177. (emacs)Lists and Sexps.
  1178.  
  1179.  - Command: forward-list &optional ARG
  1180.      This function moves forward across ARG balanced groups of
  1181.      parentheses. (Other syntactic entities such as words or paired
  1182.      string quotes are ignored.) ARG defaults to 1 if omitted.  If ARG
  1183.      is negative, move backward across that many groups of parentheses.
  1184.  
  1185.  - Command: backward-list &optional ARG
  1186.      This function moves backward across ARG balanced groups of
  1187.      parentheses. (Other syntactic entities such as words or paired
  1188.      string quotes are ignored.) ARG defaults to 1 if omitted.  If ARG
  1189.      is negative, move forward across that many groups of parentheses.
  1190.  
  1191.  - Command: up-list ARG
  1192.      This function moves forward out of ARG levels of parentheses.  A
  1193.      negative argument means move backward but still to a less deep
  1194.      spot.
  1195.  
  1196.  - Command: down-list ARG
  1197.      This function moves forward into ARG levels of parentheses.  A
  1198.      negative argument means move backward but still go deeper in
  1199.      parentheses (-ARG levels).
  1200.  
  1201.  - Command: forward-sexp &optional ARG
  1202.      This function moves forward across ARG balanced expressions.
  1203.      Balanced expressions include both those delimited by parentheses
  1204.      and other kinds, such as words and string constants.  ARG defaults
  1205.      to 1 if omitted.  If ARG is negative, move backward across that
  1206.      many balanced expressions.  For example,
  1207.  
  1208.           ---------- Buffer: foo ----------
  1209.           (concat-!- "foo " (car x) y z)
  1210.           ---------- Buffer: foo ----------
  1211.           
  1212.           (forward-sexp 3)
  1213.                => nil
  1214.           
  1215.           ---------- Buffer: foo ----------
  1216.           (concat "foo " (car x) y-!- z)
  1217.           ---------- Buffer: foo ----------
  1218.  
  1219.  - Command: backward-sexp &optional ARG
  1220.      This function moves backward across ARG balanced expressions.  ARG
  1221.      defaults to 1 if omitted.  If ARG is negative, move forward across
  1222.      that many balanced expressions.
  1223.  
  1224.  - Command: beginning-of-defun &optional ARG
  1225.      This function moves back to the ARGth beginning of a defun.  If
  1226.      ARG is negative, this actually moves forward, but it still moves
  1227.      to the beginning of a defun, not to the end of one.  ARG defaults
  1228.      to 1 if omitted.
  1229.  
  1230.  - Command: end-of-defun &optional ARG
  1231.      This function moves forward to the ARGth end of a defun.  If ARG
  1232.      is negative, this actually moves backward, but it still moves to
  1233.      the end of a defun, not to the beginning of one.  ARG defaults to
  1234.      1 if omitted.
  1235.  
  1236.  - User Option: defun-prompt-regexp
  1237.      If non-`nil', this variable holds a regular expression that
  1238.      specifies what text can appear before the open-parenthesis that
  1239.      starts a defun.  That is to say, a defun begins on a line that
  1240.      starts with a match for this regular expression, followed by a
  1241.      character with open-parenthesis syntax.
  1242.  
  1243.